<!DOCTYPE h1 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
	
<%@ include file="../../commons/common.jsp" %>

<form:form id="userNewForm" commandName="newUser" action="user.htm">

	<table class="body-table" cellpadding="0" cellspacing="0">
		<tr>
			<td class="title">Nuovo User</td>
		</tr>
		<tr>
			<td class="functions">
			<ul>
				<li onclick="frm.create('store.htm');">Salva</li>
				<li onclick="frm.back('list.htm');">Lista</li>
			</ul>
			</td>
		</tr>
	</table>
	
	<p />
	<div id="msgContainer">
		<form:errors></form:errors>
	</div>
	<p />
	
	<table class="body-table" cellpadding="0" cellspacing="0">
	
		<tr>
			<td class="detail" colspan="2">&nbsp;</td>
		</tr>
		
		<tr>
			<td class="label">Username</td>
			<td class="label">Password</td>
		</tr>
		<tr>
			<td class="detail">
				<form:input path="username" title="username" size="40%" maxlength="255" />
			</td>
			<td class="detail">
				<form:input path="password" title="password" size="40%" maxlength="255" />
			</td>
		</tr>
	
		<tr>
			<td class="detail" colspan="2">&nbsp;</td>
		</tr>
		
		<tr>
			<td class="label">Paese</td>
			<td class="label">Language</td>
		</tr>
		<tr>
			<td class="detail">
				<form:input path="country" title="country" size="40%" maxlength="255" />			
			</td>
			<td class="detail">
				<form:input path="language" title="language" size="40%" maxlength="255" />
			</td>
		</tr>
		
		<tr>
			<td class="detail" colspan="2">&nbsp;</td>
		</tr>
		
		<tr>
			<td class="label" colspan="2">Home site</td>
		</tr>
		<tr>
			<td class="detail" colspan="2">
				<form:input path="homepage" title="homepage" size="70%" maxlength="255" />
			</td>
		</tr>
		
		<tr>
			<td class="detail" colspan="2">&nbsp;</td>
		</tr>
		
		<tr>
			<td class="label" colspan="2">Enable</td>
		</tr>
		<tr>
			<td class="detail" colspan="2">
				Yes<form:radiobutton path="enabled" id="enabled" value="true"/> 
				No<form:radiobutton path="enabled" id="disabled" value="false"/> 
			</td>
		</tr>
		
	</table>
	
	<c:set var="username" value="${newUser.username}" />
	<br/>
	<table class="body-table" cellpadding="0" cellspacing="0">
		<tr>
		   	<td class="label" width="50%" style="cursor:pointer; text-align:right;"
		   		onclick="frm.addGroups('username');">
		   		ASSOCIA GRUPPI DISPONIBILI ALL'UTENTE &gt;&gt;
		   	</td>    	
		   	<td class="label" width="50%" style="cursor:pointer; text-align:left;"
		   		onClick="frm.removeGroups('username');">
		   		&lt;&lt; RIMUOVI GRUPPI ASSOCIATI
		   	</td>
		</tr>
		<tr>
			<td class="detail" style="vertical-align: top;">	
				<table class="data" cellspacing="1" cellpadding="1" style="">
					<tbody>
						<c:forEach items="${availGroups}" var="row">
							<tr>
								<td class="checkbox">
									<input type="checkbox" name="selectedGroups" value="${row}"/>
								</td>
								<td>${row}</td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</td>
			
			<td class="detail" style="vertical-align: top;">	
				<table class="data" cellspacing="1" cellpadding="1" style="">
					<tbody>
						<c:forEach items="${associatedGroups}" var="row">
							<tr>
								<td class="checkbox">
									<input type="checkbox" name="selectedGroups" value="${row}"/>
								</td>
								<td>${row}</td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</td>
		</tr>
	</table>

</form:form>

<script type="text/javascript">
<!--
var frm = new AcantoForm('userNewForm', false );

//-->
</script>
